package org.uim.cricket.db.impl;

import java.sql.ResultSet;

import org.uim.cricket.db.DBThread;

public class FindPlayerByTitleName {

	public String findPlayerID(String query) throws Exception {
		DBThread dbt = new DBThread(query);
		dbt.run();
		
		String id = null;
		ResultSet rs = dbt.getResultSet();
		while (rs.next()) {
			id = rs.getString(1);
			if (id == null || id.equalsIgnoreCase("null")) {
				id = null;
				break;
			}
		}
		dbt.close();
		
		return id;
	}
	
}
